In [2]:
import seaborn as sns
%matplotlib inline
tips = sns.load_dataset('tips')
flights = sns.load_dataset('flights')
tips.head()
Out[2]:
In [3]:
flights.head()
Out[3]:
In [5]:
tc = tips.corr()
In [8]:
sns.heatmap(tc, annot=True, cmap='coolwarm')
Out[8]:
In [9]:
flights
Out[9]:
In [13]:
fp = flights.pivot_table(index='month', columns='year', values='passengers')
In [18]:
# sns.heatmap(fp, cmap='coolwarm', linecolor='white', linewidths=1)
sns.heatmap(fp)
Out[18]:
In [21]:
sns.clustermap(fp, cmap='coolwarm', standard_scale=1)
Out[21]:
In [22]:
import seaborn as sns
%matplotlib inline
tips = sns.load_dataset('tips')
tips.head()
Out[22]:
In [26]:
sns.lmplot(x='total_bill', y='tip', data=tips, hue='sex', markers=['o', 'v'], scatter_kws={'s':100})
Out[26]:
In [32]:
sns.lmplot(x='total_bill', y='tip', data=tips, col='day', hue='sex', aspect=0.6, size=8)
Out[32]:
In [37]:
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
iris = sns.load_dataset('iris')
iris.head()
Out[37]:
In [40]:
g = sns.PairGrid(iris)
g.map_diag(sns.distplot)
g.map_upper(plt.scatter)
g.map_lower(sns.kdeplot)
Out[40]:
In [41]:
tips = sns.load_dataset('tips')
tips.head()
Out[41]:
In [44]:
g = sns.FacetGrid(data=tips, col='time', row='smoker')
g.map(plt.scatter, 'total_bill', 'tip')
Out[44]:
In [45]:
import seaborn as sns
%matplotlib inline
tips = sns.load_dataset('tips')
tips.head()
Out[45]:
In [62]:
#sns.set_style('ticks')
#plt.figure(figsize=(12,3))
sns.set_context('paper')
sns.countplot(x='sex', data=tips)
Out[62]:
In [64]:
sns.lmplot(x='total_bill', y='tip', data=tips, hue='sex', palette='seismic')
Out[64]: